//
//  SingletonClass.m
//  MacTestProject
//
//  Created by LiuLichen on 2022/4/29.
//

#import "SingletonClass.h"

static SingletonClass* instance = nil;

@implementation SingletonClass

+ (id) sharedInstance {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
    });
    return instance;
}

+ (id) allocWithZone:(struct _NSZone *)zone {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc] init];
    });
    return instance;
}

@end
